import {
  axios
} from '@/utils/request'

// 查询表格数据
export function queryPageList(parameter) {
  return axios({
    url: 'jbd/serviceFormDesign/queryPage',
    method: 'GET',
    params: parameter,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  })
}

// 通过id获取详情信息
export function queryById(parameter) {
  return axios({
    url: `jbd/serviceFormDesign/queryById/${parameter.id}`,
    method: 'GET',
    // params: parameter,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  })
}

// 部门管理-我的部门
export function MyDeptTreeList(parameter) {
  return axios({
    url: 'sys/sysDepart/queryMyDeptTreeList',
    method: 'GET',
    params: parameter,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  })
}

// 部门管理-获取所有部门
export function getAllDepTreeList(parameter) {
  return axios({
    url: 'sys/sysDepart/queryTreeList',
    method: 'GET',
    params: parameter,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  })
}

// 添加
export function serviceAdd(parameter) {
  return axios({
    url: 'jbd/serviceFormDesign/add',
    method: 'POST',
    data: parameter,
    headers: {
      'Content-Type': 'application/json',
    }
  })
}
// 修改
export function serviceEdit(parameter) {
  return axios({
    url: 'jbd/serviceFormDesign/edit',
    method: 'POST',
    data: parameter,
    headers: {
      'Content-Type': 'application/json',
    }
  })
}
// 删除
export function deleteByIds(data) {
  return axios({
    url: `jbd/serviceFormDesign/deleteByIds/${data.ids}`,
    method: 'DELETE',
    // params: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  })
}

// 用户管理-部门用户
export function departUserList(parameter) {
  return axios({
    url: 'sys/user/departUserList',
    method: 'GET',
    params: parameter,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  })
}

// 服务基础数据
export function queryAll() {
  return axios({
    url: 'jbd/jbdService/queryAll',
    method: 'GET',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  })
}

